<template>
  <i-frame :src="openUrl" id="jimuReportFrame" ref="jimu" />
</template>

<script>
import { getToken } from '@/utils/auth'
import iFrame from "@/components/iFrame/index";

export default {
  name: 'jmreport',
  components: { iFrame },
  data() {
    return {
      openUrl: process.env.VUE_APP_BASE_API + '/jimu/jmreport/list?token=' +  getToken()
    }
  },
  mounted(){
        const iframe = document.querySelector('#jimuReportFrame iframe')
        if (iframe.attachEvent) {
            iframe.attachEvent('onload', () => {
                let iframeDocument = document.getElementsByTagName("iframe")[0].contentDocument;
                let layoutDocument = iframeDocument.getElementsByClassName('layout')[0]
                let header = layoutDocument.getElementsByTagName("div")[0]
                header.style.display = 'none'
                })
            } else {
                iframe.onload = () => {
                    let iframeDocument = document.getElementsByTagName("iframe")[0].contentDocument;
                let layoutDocument = iframeDocument.getElementsByClassName('layout')[0]
                let header = layoutDocument.getElementsByTagName("div")[0]
                header.style.display = 'none'
            }
        }
    
  }
}
</script>

<style scoped>
#jimuReportFrame iframe{
    display:none
}
</style>
